<template>
  <div>
    <input type="text" placeholder="请输入用户名" @keydown.enter="search" v-model="searchValue"/>
  </div>
</template>

<script>
export default {
  name: "searchGitHub",
  data() {
    return {
      searchValue: "",
    };
  },
  methods: {
    search(event) {
      this.$bus.$emit("search", this.searchValue);
      event.target.value = "";
      this.searchValue = "";
    },
  },
};
</script>

<style lang="less" scoped>
input {
  width: 240px;
  height: 30px;
  border-radius: 4px;
  &:focus {
    border-color: antiquewhite;
  }
}
</style>